﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="MenuControl.ascx.cs" Inherits="UserControl_MenuControl" %>
<%@ Import Namespace="BLL.Common" %>
<%@ Import Namespace="Module" %>

<script type="text/javascript">
    $().ready(
    function () {
        $(".page_center").toggle(
            function () {
                $(".page_left,.left_middle").animate({ width: 'toggle', opacity: 'toggle' }, "slow");
                $(".page_right").animate({ width: '97%' }, "slow");
                $(".page_center").css("background", "url(<%=Contexts.AdminPath%>/images/main_41.gif) no-repeat");
            },
            function () {
                $(".page_right").animate({ width: '80%' }, "slow");
                $(".page_left,.left_middle").animate({ width: 'toggle', opacity: 'toggle' }, "slow");
                $(".page_center").css("background", "url(<%=Contexts.AdminPath%>/images/main_41_1.gif) no-repeat");

            }
        );
        leftShowAndClose();
        var height_ = $("#pall").height() - 50;
        $("#pleft").css({ "min-height": height_ + "px", "_height": height_ + "px" });

        if ($.browser.version == "6.0") {
            var _height_ = document.documentElement.clientHeight - 80;
            $("#pleft").css({ "height": _height_ + "px" });
        }

        var height_ = $("#pall").height() - 50;
        $("#pleft").css({ "min-height": height_ + "px", "_height": height_ + "px" });
    });


    function leftShowAndClose() {
        $(".left_tree .tree_title").toggle(
            function () {
                $(this).find("img").attr("src", "<%=Contexts.AdminPath%>/images/arrow.gif");
                $(this).next().animate({ height: 'toggle', opacity: 'toggle' }, "slow");
            },
            function () {
                $(this).find("img").attr("src", "<%=Contexts.AdminPath%>/images/arrow2.gif");
                $(this).next().animate({ height: 'toggle', opacity: 'toggle' }, "slow");
            }
        )
    }

    function leftShowAll() {
        $("#pleft").css({ height: "100%" });
        $(".left_tree .tree_title").find("img").attr("src", "<%=Contexts.AdminPath%>/images/arrow.gif");
        $(".left_tree ul").show();
    }
    function leftCloseAll() {
        $(".left_tree .tree_title").find("img").attr("src", "<%=Contexts.AdminPath%>/images/arrow2.gif");
        $(".left_tree ul").hide();

        //alert($("#pleft").height());
    }
</script>

<div class="page_left" id="pleft">
    <div class="left_up" id="pleftup">
        <a href="<%=Contexts.AdminPath%>/Index.aspx"  title="展开" id="a1">回到首页</a>| <a href="#" onclick="leftShowAll();" title="展开" id="allopen">展开</a>|<a href="#"
            onclick="leftCloseAll();" title="折叠" id="allclose" class="allclose">折叠</a></div>
    <!--left center-->
    <div class="left_middle" id="leftm">
        <!--left tree1-->
        <asp:Repeater ID="rptMenuRoot" runat="server" OnItemDataBound="rptMenuRoot_ItemDataBound">
            <ItemTemplate>
                <div class="left_tree">
                    <div class="tree_title">
                        <a href="#" hidefocus="true"><%#((Module.MenuInfo)Container.DataItem).MenuName%></a>
                    </div>
                    <ul class="tree_list" id="list<%#((Module.MenuInfo)Container.DataItem).MenuId%>">
                        <asp:Literal ID="litModuleId" runat="server" Visible="false" Text="<%#((Module.MenuInfo)Container.DataItem).MenuId%>" />
                        <asp:Repeater ID="rptMenuChild" runat="server" OnItemDataBound="rptMenuChild_ItemDataBound">
                            <ItemTemplate>
                                <li class="first"><span>
                                    <img src="<%=Contexts.AdminPath%>/images/arrow2.gif" />
                                </span><a runat="server" id="a_link">
                                    <%#((Module.MenuInfo)Container.DataItem).MenuName%>
                                </a></li>
                            </ItemTemplate>
                        </asp:Repeater>
                    </ul>
                </div>
            </ItemTemplate>
        </asp:Repeater>
    </div>
</div>
<!--page center-->
<div class="page_center" title="展开/关闭">
    &nbsp;
    <%--<a href="#" title="展开/关闭左列表" id="shrink" onclick="swithbar(this)">7</a>--%>
</div>
